<?php
namespace Core\CoreComponents\DocumentsManager;
/**
* This interface provide all accessible methods on documents module
*
* @method ServiceResponse getDocuments($root, $forceToRefresh, $filter)
* @method ServiceResponse getDocumentsCount($root)
* @method ServiceResponse uploadDocument($tempPath, $dirPath, $filename)
* @method ServiceResponse deleteDocument($path)
* @method ServiceResponse renameDocument($path, $newName, $oldName)
* @method ServiceResponse createTempDocument($sourcePath)
* @method ServiceResponse createFolder($path, $name)
*/
interface IDocuments
{
	/**
	 * Get all documents from root
	 * 
	 * @param string $root The new value 
	 * @param boolean $forceToRefresh Force to refresh the cache value on the server side
	 * @param string $filter Set a filter on the search pattern
	 *
	 * @return ServiceResponse The response contains all documents found on the provided path with the filter
	 */
    public function getRecursiveDocuments($root, $forceToRefresh, $filter);
	
	/**
	 * Get all documents from root
	 * 
	 * @param string $root The new value 
	 * @param boolean $forceToRefresh Force to refresh the cache value on the server side
	 * @param string $filter Set a filter on the search pattern
	 *
	 * @return ServiceResponse The response contains all documents found on the provided path with the filter
	 */
    public function getDocuments($root, $forceToRefresh, $filter);
	
	/**
	 * Get the number of documents from root
	 * 
	 * @param string $root The new value 
	 *
	 * @return ServiceResponse The response contains all documents found on the provided path
	 */
    public function getDocumentsCount($root);
	
	/**
	 * Upload document
	 * 
	 * @param string $tempPath The temp path use to upload the document
	 * @param string $dirPath The target directory to copy the file
	 * @param string $filename The file name to copy
	 *
	 * @return ServiceResponse The response contains the uploaded document
	 */
    public function uploadDocument($tempPath, $dirPath, $filename);
	
	/**
	 * Delete a document from his path
	 * 
	 * @param string $path The path use to delete the document
	 *
	 * @return ServiceResponse The response contains the deleted document
	 */
    public function deleteDocument($path);
	
	/**
	 * Rename document
	 * 
	 * @param string $path The document path to rename
	 * @param string $newName The new document name
	 * @param string $oldName The old document name
	 *
	 * @return ServiceResponse The response contains the renamed document
	 */
    public function renameDocument($path, $newName, $oldName);
	
	/**
	 * Create a temporary file to download
	 * 
	 * @param string $sourcePath The path to the targeted document 
	 * 
	 * @return ServiceResponse The response contains the new temporary document 
	 */
    public function createTempDocument($sourcePath);
	
	/**
	 * Create a temporary file to download
	 * 
	 * @param string $sourcePath The path to the targeted document 
	 * 
	 * @return ServiceResponse The response contains the new temporary document 
	 */
    public function createTempDocumentFromBinary($fileName, $fileExtension, $binaryDataFile);
	
	/**
	 * Create a folder
	 * 
	 * @param string $path The path to the targeted repository 
	 * @param string $name The name of the targeted folder to create
	 *
	 * @return ServiceResponse The response contains the created folder
	 */
    public function createFolder($path, $name);
}

?> 